/*
    日志消息类的实现——封装一条完整的日志消息所需要的内容
    1.日志打印的时间
    2.日志等级
    3.源文件名
    4.行号
    5.线程ID
    6.日志器名称
    7.日志主体消息——有效载荷
*/
   
#ifndef __M_MESSAGE_H__
#define __M_MESSAGE_H__

#include <iostream>
#include <string>
#include <thread>
#include "util.hpp"
#include "level.hpp"

namespace mylog{
    class logmsg{
    public:
        logmsg(loglevel::value level, const std::string &filename, const size_t line,
                const std::string &logger, const std::string &message)
        :_ctime(util::Data::now()),
        _level(level),
        _filename(filename),
        _line(line),
        _tid(std::this_thread::get_id()),
        _logger(logger),
        _message(message)
        {}
        
        time_t _ctime;
        loglevel::value _level;
        std::string _filename;
        size_t _line;
        std::thread::id _tid;
        std::string _logger;
        std::string _message;
    };
}

#endif